import plotly.graph_objects as go
import numpy as np

t = np.linspace(0, 10, 100)
x, y, z = np.cos(t), np.sin(t), t

fig = go.Figure(
    data=[
        go.Scatter3d(
            x=x,
            y=y,
            z=z,
            mode="markers",
            marker=dict(
                size=12,
                color=z,  # 按z轴值设置颜色
                colorscale="Viridis",  # choose a colorscale
                opacity=0.8,
            ),
        )
    ]
)
fig.show()
